import request from "@/utils/request.ts";
import { TrademarkListResponse, TrademarkItem } from "./models/trademarkType";

// 获取商品数据
export const reqGetTradeMarkList = (page: number, limit: number) => {
  return request.get<any, TrademarkListResponse>(
    `/admin/product/baseTrademark/${page}/${limit}`
  );
};

/**
 * 添加商品
 * @param tmName
 * @param logoUrl
 * @returns null
 */
export const reqAddTradeMark = (tmName: string, logoUrl: string) => {
  return request.post<any, null>("/admin/product/baseTrademark/save", {
    tmName,
    logoUrl,
  });
};

/**
 * 修改品牌
 * @param trademark
 * @returns null
 */
export const reqEditTradeMark = (trademark: TrademarkItem) => {
  return request.put<any, null>(
    "/admin/product/baseTrademark/update",
    trademark
  );
};

/**
 * 删除品牌
 * @param id
 * @returns
 */
export const reqDeleteTradeMark = (id: number) => {
  return request.delete<any, null>(`/admin/product/baseTrademark/remove/${id}`);
};
